#/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

import maya.cmds as cmds

class Validation(object):
    name = u'EmptySet | 空集检查'
    dataDict = dict()

    def execute(self):
        self.dataDict = {}
        defaultSetList = ['defaultLightSet', 'defaultObjectSet', 'initialParticleSE', 'initialShadingGroup']
        setList = cmds.ls(sets=1)
        if setList:
            for set in setList:
                if set not in defaultSetList:
                    if not cmds.sets(set, q=1):
                        self.dataDict[set] = []
        return self.dataDict

    def correct(self):
        for set, _ in self.dataDict.items():
            cmds.delete(set)

    def search(self, obj):
        cmds.select(obj, ne=1)